package com.zero2oneblog.controller;

import com.zero2oneblog.entity.Post;
import com.zero2oneblog.mapper.PostMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liangjiu
 * @since 2024-01-09
 */
//@Controller
//@RequestMapping("/zero2oneblog/post")
@RestController
public class PostController {
    @Autowired
    private PostMapper postMapper;

    @GetMapping("/public/getPost")
    public List<Post> get(int id){
//        return (HashMap<String, String>) postMapper.postSelect(id);
        return postMapper.postSelect(id);
    }
}
